﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.ServiceModel.DomainServices.Client;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;

namespace Candy.Model
{
    public class CandyLoadOperation<T> : CandyOperationBase where T : Entity
    {

        public IEnumerable<ValidationResult> ValidationErrors { get; private set; }

        private IEnumerable<T> _entities;
        public IEnumerable<T> Entities
        {
            get
            {
                return _entities;
            }

            private set
            {
                _entities = value;
            }
        }



        public CandyLoadOperation(LoadOperation<T> loadOperation) : base(loadOperation)
        {
            Entities = loadOperation.Entities;
            ValidationErrors = loadOperation.ValidationErrors;
        }

        public CandyLoadOperation(IEnumerable<T> entities, Exception error, IEnumerable<ValidationResult> validationErrors )  : base(error)
        {
            Entities = entities;
            ValidationErrors = validationErrors;
        }



    }
}
